"""

"""
import socket

socket_server = socket.socket()
# 绑定ip和端口号
socket_server.bind(("localhost",6688))

# 监听端口 接受的链接数量
socket_server.listen(1)
# 等待链接
conn,address = socket_server.accept()

print(f"接收到了客户端的链接,客户端的信息是:{address}")

while True:
    data = conn.recv(1024).decode("UTF-8")
    print(f"客户端发送来的消息是：{data}")
    if data == "exit":
        break
    msg = input("请输入你要和客户端回复的消息:").encode("UTF-8")
    conn.send(msg)

# 关闭链接
conn.close()